using System;
using System.Xml.Serialization;
using System.Collections;
using System.Globalization;
using System.IO;

namespace ExchangeHelpers
{
	/// <summary>
	/// Summary description for SiteParametersClass.
	/// </summary>
	[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
	public class ConvertFolderToType 
	{
    
		/// <remarks/>
		//[System.Xml.Serialization.XmlElementAttribute("Instance")]
		//public ExporterServiceInstance[] Items;

		/// <remarks/>
		[System.Xml.Serialization.XmlElementAttribute("NameContains", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
		public  ConvertFolderToTypeCollection List;
		
		public ConvertFolderToType()
		{
			List=new ConvertFolderToTypeCollection();
		}
		public bool Serialize(string fileName)
		{
			StreamWriter exportItemsFile = new StreamWriter(fileName,false);
			XmlSerializer mySerializer = new XmlSerializer(typeof(ExchangeHelpers.ConvertFolderToType));
			mySerializer.Serialize(exportItemsFile , this); 
			return(true);
		}
		/// <remarks/>
	}

	/// <remarks/>
	public class NameContains 
	{
		/// <remarks/>
		[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
		public string KeyWord;
    
		[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
		public string ConvertTo;

	}
	public class ConvertFolderToTypeCollection : ICollection
	{
		public ConvertFolderToTypeCollection()
		{
			nameContainsCollection=new ArrayList();
		}
		
		private ArrayList nameContainsCollection;
		#region ICollection Members

		public bool IsSynchronized
		{
			get
			{
				// TODO:  Add ExchangePropertyCollection.IsSynchronized getter implementation
				return nameContainsCollection.IsSynchronized;
			}
		}

		public int Count
		{
			get
			{
				// TODO:  Add ExchangePropertyCollection.Count getter implementation
				return nameContainsCollection.Count;
			}
		}

		public void CopyTo(NameContains[] a, int index)
		{
			nameContainsCollection.CopyTo(a, index);
		}

		public void CopyTo(Array a, int index)
		{
			nameContainsCollection.CopyTo(a, index);
		}

		public object SyncRoot
		{
			get
			{
				// TODO:  Add ExchangePropertyCollection.SyncRoot getter implementation
				return nameContainsCollection.SyncRoot;
			}
		}

		#endregion

		#region IEnumerable Members

		public IEnumerator GetEnumerator()
		{
			// TODO:  Add ExchangePropertyCollection.GetEnumerator implementation
			return nameContainsCollection.GetEnumerator();
		}
		public NameContains this[int index]
		{
			get{return (NameContains) nameContainsCollection[index];}
		}
		/// <summary>
		/// Adds an object to the end of the ArrayList.
		/// </summary>
		/// <param name="newProfile">New Profile to be added to the list</param>
		public void Add(NameContains newItem)
		{
			nameContainsCollection.Add(newItem);
		}


		#endregion

	}
}
